<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: YanHilin
  Date: 2020/5/2
  Time: 13:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>订单详情</title>
    <base href="http://localhost:8080/onlineflower/">
    <%@ include file="/page/comment/head.jsp"%>
</head>
<body>
<%@include file="/page/user/head_nav.jsp"%>
<div id="content">
    <c:forEach items="${requestScope.orderItems}" var="item">
        <div class="card">
            <h5 class="card-header">
                <span name="enterpriseid">商家编号： ${item.enterpriseid}</span>   &nbsp;&nbsp;
                <%--<span ></span>--%>
                <span name="id">编号： ${item.id}</span>  &nbsp;&nbsp;
            </h5>
            <div class="card-body">
                <input type="hidden" name="orderitemid" value="${item.id}">
                <p class="card-text">
                <ul style="list-style: none">
                <li><span name="orderid" style="letter-spacing: 2px">订单号：${item.orderid}</span></li>
               <li><span style="letter-spacing: 2px" name="flower_name">鲜花： ${item.name}</span></li>
                <li><span>数量： ${item.count} 件</span></li>
                    <li><span>单价：${item.price}</span></li>
                    <li><span> 总金额： ${item.totalprice}</span></li>
                <li><span>收货人：${sessionScope.user.relname}</span></li>
                <li><span>联系方式：${sessionScope.user.telephone}</span></li>
                <li><span>收货地址：${sessionScope.user.address}</span></li>
                <li><span>发货人：${item.relname}</span></li>
                <li><span>联系方式：${item.telephone}</span></li>
                <li><span>发货地址：${item.address}</span></li>
            </ul>
                </p>
                <c:if test="${item.status==0}">
                      <a  class="reminding btn btn-secondary btn-lg btn-block" href="javascript:void(0)"><svg class="bi bi-alarm" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                          <path fill-rule="evenodd" d="M8 15A6 6 0 1 0 8 3a6 6 0 0 0 0 12zm0 1A7 7 0 1 0 8 2a7 7 0 0 0 0 14z" clip-rule="evenodd"/>
                          <path fill-rule="evenodd" d="M8 4.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.053.224l-1.5 3a.5.5 0 1 1-.894-.448L7.5 8.882V5a.5.5 0 0 1 .5-.5z" clip-rule="evenodd"/>
                          <path d="M.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z"/>
                          <path fill-rule="evenodd" d="M11.646 14.146a.5.5 0 0 1 .708 0l1 1a.5.5 0 0 1-.708.708l-1-1a.5.5 0 0 1 0-.708zm-7.292 0a.5.5 0 0 0-.708 0l-1 1a.5.5 0 0 0 .708.708l1-1a.5.5 0 0 0 0-.708zM5.5.5A.5.5 0 0 1 6 0h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z" clip-rule="evenodd"/>
                          <path d="M7 1h2v2H7V1z"/>
                      </svg>提醒发货</a>
                </c:if>
                <c:if test="${item.status==1}">
                    <a  class="receiving btn btn-secondary btn-lg btn-block" href="orderItemServlet?action=receiverOrderItem&orderid=${item.id}"><span class="glyphicon glyphicon-send"></span>  确认收货</a>
                </c:if>
                <c:if test="${item.status==2}">
                    <a  class="goEvaluate btn btn-secondary btn-lg btn-block" href="orderItemServlet?action=getOrderItem&id=${item.id}"><svg class="bi bi-pencil" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                        <path fill-rule="evenodd" d="M11.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1 0 1.414l-9 9a1 1 0 0 1-.39.242l-3 1a1 1 0 0 1-1.266-1.265l1-3a1 1 0 0 1 .242-.391l9-9zM12 2l2 2-9 9-3 1 1-3 9-9z" clip-rule="evenodd"/>
                        <path fill-rule="evenodd" d="M12.146 6.354l-2.5-2.5.708-.708 2.5 2.5-.707.708zM3 10v.5a.5.5 0 0 0 .5.5H4v.5a.5.5 0 0 0 .5.5H5v.5a.5.5 0 0 0 .5.5H6v-1.5a.5.5 0 0 0-.5-.5H5v-.5a.5.5 0 0 0-.5-.5H3z" clip-rule="evenodd"/>
                    </svg> 去评价</a>
                </c:if>
                <c:if test="${item.status==3}">
                    <a  class="goEvaluate btn btn-secondary btn-lg btn-block" href="javascript:void(0)"><svg class="bi bi-pencil" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                        <path fill-rule="evenodd" d="M11.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1 0 1.414l-9 9a1 1 0 0 1-.39.242l-3 1a1 1 0 0 1-1.266-1.265l1-3a1 1 0 0 1 .242-.391l9-9zM12 2l2 2-9 9-3 1 1-3 9-9z" clip-rule="evenodd"/>
                        <path fill-rule="evenodd" d="M12.146 6.354l-2.5-2.5.708-.708 2.5 2.5-.707.708zM3 10v.5a.5.5 0 0 0 .5.5H4v.5a.5.5 0 0 0 .5.5H5v.5a.5.5 0 0 0 .5.5H6v-1.5a.5.5 0 0 0-.5-.5H5v-.5a.5.5 0 0 0-.5-.5H3z" clip-rule="evenodd"/>
                    </svg> 已完成</a>
                </c:if>
            </div>
        </div>
        <br/>
    </c:forEach>
</div>
</body>
<script>
    $(function () {

        $("a.reminding").click(function () {
            if (confirm("提醒商家发货？")){
                alert("商家已收到发货请求！")
            }else{
                alert("已取消");
            }
        })
        $("a.receiving").click(function () {

            if(confirm("确认收货吗？")){
                alert("已成功签收！");
            }else{
                return false;
            }
        })
    })
</script>
</html>
